home *** CD-ROM | disk | FTP | other *** search
/ CD-ROM Today (BR) Volume 4 #13 / CD-ROM Today Volume 4 nº 13 Aces Over Europe.iso / aoe / title.mst < prev    next >
Text File  |  1994-07-28  |  22KB  |  600 lines

  1. '**************************************************************************
  2. '*
  3. '* TITLE.MST - Viewer Runtime Setup Script
  4. '*
  5. '* CUSTOMIZING TITLE.MST
  6. '*
  7. '* For a simple Setup routine, you just need to assign values to the 
  8. '* series of variables following the heading "Setup Variables". This
  9. '* script also provides for the following more-advanced options, which
  10. '* are supported by subroutines located later in this script:
  11. '*
  12. '* Option                                         See Subroutine
  13. '* ------------------------------------------     ---------------------
  14. '* Install more than one .MVB file                ModifyViewerIni
  15. '* Install Help title                             ModifyViewerIni
  16. '* Install custom DLLs                            ModifyViewerIni
  17. '* Install multiple Program Manager items         ModifyProgramManager
  18. '* Display a custom icon with the ProgMan item    ModifyProgramManager
  19. '* Install custom fonts                           RegisterCustomFonts
  20. '* Install Video for Windows runtime files        RegisterDrivers
  21. '*
  22. '* Each customization note starts with the heading CUSTOMIZATION.
  23. '*
  24. '**************************************************************************
  25.     
  26.     '' Global variables
  27.  
  28.     GLOBAL TitleShortName$
  29.     GLOBAL TitleLongName$
  30.     GLOBAL MVBFileName$
  31.     GLOBAL PromptForPath%
  32.     GLOBAL DefaultPath$
  33.     GLOBAL ProgManGroup$
  34.     GLOBAL DemoGroup$
  35.     GLOBAL ProgManItem$
  36.      GLOBAL installChoice$ 
  37.     '' ****************************************************************
  38.     '' ** Setup Variables
  39.     '' ****************************************************************
  40.  
  41.     '' Set the following string to a short form of the title name
  42.     '' (for example, "Gallery")
  43.     
  44.     TitleShortName$ = "Aces Over Europe"
  45.     
  46.     '' Set the following string to a long form of the title name
  47.     '' (for example, "Viewer 2.0 Gallery")
  48.     
  49.     TitleLongName$ = "Aces Over Europe"
  50.         
  51.     '' Set the following variable to the name of the MVB file, without 
  52.     '' the filename extension (for example, "GALLERY")
  53.         
  54.     MVBFileName$ = "Manual"
  55.         
  56.     '' The following variable determines whether Setup prompts the user
  57.     '' to specify a directory in which to install title files. (Files
  58.     '' to be installed on the hard disk must be listed in the TITLE.INF 
  59.     '' file under the [Installed Title Files] section.) Specify one of
  60.     '' the following values:
  61.     ''
  62.     '' 0    Install title files in the Windows directory (default setting).
  63.     ''      This is an appropriate setting if you have a limited number
  64.     ''      of files to copy (for example, a single custom icon or DLL).
  65.     ''
  66.     '' 1    Display a dialog box to prompt the user for a directory in 
  67.     ''      which to install files
  68.         
  69.     PromptForPath% = 1
  70.         
  71.     '' If you have specified 1 in PromptForPath%, set the following 
  72.     '' variable to the default path that will be displayed in the dialog
  73.     '' box (for example, "C:\GALLERY").
  74.         
  75.     DefaultPath$ = "C:\DYNAMIX\AOE"
  76.     
  77.     '' Set the following variable to the name of the program manager 
  78.     '' group you would like to create (for example, "Viewer 2.0 Gallery")
  79.         
  80.     ProgManGroup$ = "Aces Over Europe"   
  81.     DemoGroup$ = "Dynamix/Sierra  Demos"
  82.     
  83.     '' Set the following variable to the caption of the program manager 
  84.     '' item for your title (for example, "Gallery")
  85.         
  86.     ProgManItem$ = "Aces Over Europe Manual"
  87.     '***********************************************************************
  88.     '** Mainline
  89.     '***********************************************************************
  90.  
  91.     GLOBAL CUIDLL$
  92.  
  93.     '' Include files
  94.     '$INCLUDE 'setupapi.inc'
  95.     
  96.     '' Custom UI dll
  97.     CUIDLL$ = "mscuistf.dll"
  98.     
  99.     '' Dialog ID's   
  100.     CONST DESTPATH      = 1000
  101.     CONST APPHELP       = 2000
  102.     CONST TOOBIG        = 3000
  103.     CONST BADPATH       = 4000
  104.     CONST SUCCESS       = 5000       
  105.     CONST AFTERINSTALL = 111    
  106.     CONST TOPLAY = 112
  107.     '' Bitmap ID
  108.     CONST LOGO = 1  
  109.     CONST GAMEICON = 109
  110.     '' Functions and subroutines
  111.     DECLARE FUNCTION AddFont LIB "mscuistf.dll" (szFont$, szName$) AS INTEGER
  112.     DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  113.     DECLARE FUNCTION GetTitleDir (szDefault$) AS STRING
  114.     DECLARE FUNCTION GetInstallChoice () AS STRING
  115.     DECLARE FUNCTION CopyFiles(szTitleDir$) AS INTEGER
  116.     DECLARE FUNCTION CreateGamePif LIB "mscuistf.dll" (cdDir$, paramline$, pifname$,progname$) AS INTEGER
  117.     DECLARE FUNCTION CreateGameBatchFile LIB "mscuistf.dll" (batname$,switchdir$,param$,gameName$) AS INTEGER
  118.     DECLARE FUNCTION RunProg LIB "mscuistf.dll" (progname$,workDir$,returndir$) AS INTEGER
  119.     DECLARE FUNCTION CreateGameINIFile LIB "mscuistf.dll" (iniFile$,line1$,line2$,line3$,line4$,line5$,line6$,line7$) AS INTEGER
  120.     DECLARE FUNCTION ShowMaximized LIB "mscuistf.dll" (hwnd%) AS INTEGER
  121.     DECLARE SUB RegisterFont(fontfile$, fontname$)
  122.     DECLARE SUB ModifyViewerIni
  123.     DECLARE SUB RegisterCustomFonts
  124.     DECLARE SUB ModifyProgramManager(szTitleDir$)
  125.     DECLARE SUB ShowSuccess         
  126.     DECLARE SUB ShowEndStuff
  127.     DECLARE SUB RegisterDrivers
  128.     '' The following statement turns size checking off. Set it to scmOnFatal 
  129.     '' to enable size checking, where Setup will compare the disk file size 
  130.     '' with the INF file size and report an error if they are not the same.
  131.     
  132.     i% = SetSizeCheckMode(scmOff)
  133.     
  134.     '' Set the title and banner bitmap. You must rebuild MSCUISTF.DLL to 
  135.     '' alter the banner bitmap.
  136.     i%=ShowMaximized(HwndFrame())
  137.     
  138.     SetTitle "Aces Over Europe Setup"
  139. '*    SetBitmap CUIDLL$, LOGO 
  140.     '' Read in the INF file.
  141.     
  142.     ReadInfFile GetSymbolValue("STF_CWDDIR") + "TITLE.INF"
  143.  
  144.      installChoice$ = GetInstallChoice()
  145.     IF  installChoice$ = "EXIT" THEN
  146.         GOTO QUIT
  147.     ENDIF    
  148.     
  149.     '' Decide where to put title files
  150.     IF PromptForPath% = 1 THEN
  151.         szTitleDir$ = GetTitleDir(DefaultPath$)
  152.         IF szTitleDir$ = "" THEN
  153.             GOTO QUIT
  154.         ENDIF
  155.     ELSE
  156.         szTitleDir$ = GetWindowsDir()
  157.     ENDIF   
  158.  
  159.  
  160.     '' Copy files
  161.     IF CopyFiles(szTitleDir$) = 0 THEN
  162.         GOTO QUIT
  163.     ENDIF
  164.      '' Create the MVIEWER2.EXE MVB association 
  165.     CreateIniKeyValue "WIN.INI", "Extensions", "MVB", "mviewer2.exe", cmoNone
  166.  
  167.     '' Register in VIEWER.INI
  168.     ModifyViewerIni
  169.  
  170.     '' Register custom fonts
  171.     RegisterCustomFonts
  172.  
  173.     '' Register drivers
  174.     RegisterDrivers
  175.     
  176.     '' Modify Program Manager
  177.     ModifyProgramManager(szTitleDir$)    
  178.  
  179.     '' Success dialog
  180.     ShowSuccess
  181.     
  182.     '' Now start the title
  183.  
  184. '*    RUN "mviewer2.exe " + MVBFileName$ + ".MVB", NOWAIT
  185. '*    RUN szTitleDir$+"\install.exe",NOWAIT
  186. '*    i%=RunProg("install.exe",szTitleDir$,GetSymbolValue("STF_SRCDIR"))
  187.     ShowEndStuff
  188.     i%=RunProg("wininst.exe "+szTitleDir$,GetSymbolValue("STF_SRCDIR"),GetSymbolValue("STF_SRCDIR"))
  189.  
  190. QUIT:
  191.     
  192.     END
  193. '*************************************************************************
  194. '** Purpose:
  195. '**     Prompts the user for an installation choice
  196. '** Arguments:
  197. '**     none
  198. '** Returns:
  199. '**     IDC_B for small install IDC_C for large install or IDC_X to quit.
  200. '*************************************************************************
  201.  
  202. FUNCTION GetInstallChoice () STATIC AS STRING
  203.  
  204.     SetSymbolValue "String1", "5 megs"
  205.      installChoice$ = UIStartDlg(CUIDLL$, 102, "FInfoDlgProc", APPHELP, "FHelpDlgProc")      
  206.      UIPop 1
  207.     GetInstallChoice = installChoice$
  208. END FUNCTION
  209.     
  210.  
  211. '*************************************************************************
  212. '** Purpose:
  213. '**     Prompts the user for a path for the title files
  214. '** Arguments:
  215. '**     szDefault$ - default path
  216. '** Returns:
  217. '**     New valid path name, or "" if the user quit.
  218. '*************************************************************************
  219.  
  220. FUNCTION GetTitleDir (szDefault$) STATIC AS STRING
  221.  
  222.     SetSymbolValue "String", TitleShortName$
  223.     SetSymbolValue "EditTextIn", szDefault$
  224.     SetSymbolValue "EditFocus", "ALL"
  225.  
  226.     GETPATH:
  227.  
  228.     sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP, "FHelpDlgProc")
  229.  
  230.     IF sz$ = "CONTINUE" THEN
  231.         szTitleDir$ = GetSymbolValue("EditTextOut")
  232.         IF IsDirWritable(szTitleDir$) = 0 THEN
  233.  
  234.             BADPATH:
  235.  
  236.             sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfoDlgProc", 0, "")
  237.             IF sz$ = "REACTIVATE" THEN
  238.                 GOTO BADPATH
  239.             END IF
  240.             UIPop 1
  241.             GOTO GETPATH
  242.         END IF
  243.         UIPop 1
  244. '*        IF  DoesDirExist(szTitleDir$) = 0 THEN
  245.             CreateDir szTitleDir$, cmoNone 
  246. '*        END IF
  247.         sz2Dir$=szTitleDir$+"\tapes"  
  248. '*        IF DoesDirExist(sz2Dir$) = 0 THEN
  249.             CreateDir sz2Dir$,cmoNone
  250. '*        END IF
  251.         
  252.  
  253.     ELSEIF sz$ = "REACTIVATE" THEN
  254.         GOTO GETPATH
  255.  
  256.     ELSE
  257.         szTitleDir$ = ""
  258.  
  259.     END IF
  260.      GetTitleDir = szTitleDir$
  261.  
  262. END FUNCTION
  263.  
  264.  
  265. '*************************************************************************
  266. '** Purpose:
  267. '**     Copies the files in the INF file
  268. '** Arguments:
  269. '**     szTitleDir$ - destination directory for the title files
  270. '** Returns
  271. '**     1 if files were copied, 0 otherwise
  272. '*************************************************************************
  273.  
  274. FUNCTION CopyFiles(szTitleDir$) STATIC AS INTEGER
  275.  
  276.     AddSectionFilesToCopyList "System Files", GetSymbolValue("STF_SRCDIR"), GetWindowsSysDir()
  277.     
  278.     '' Add all of the title files to the copy list
  279.     AddSectionFilesToCopyList "Installed Title Files", GetSymbolValue("STF_SRCDIR"), szTitleDir$
  280.     szSrcDir$ = GetSymbolValue("STF_SRCDIR")  + "tapes"
  281.     szTapeDir$=szTitleDir$+"\tapes"  
  282.     AddSectionFilesToCopyList "Tapes Directory", szSrcDir$, szTapeDir$
  283.       IF installChoice$ = "CONTINUE" THEN
  284.         AddSectionFilesToCopyList "Full Install Files", GetSymbolValue("STF_SRCDIR"), szTitleDir$
  285.     END IF    
  286.     
  287.     '' Check size
  288.     szExtras$ = "Extra"
  289.     szCosts$ = "Costs"
  290.     szNeededs$ = "Neededs"
  291.     FOR i% = 1 TO 26 STEP 1
  292.         AddListItem szExtras$, "0"
  293.     NEXT i%
  294.     
  295.     '' We assume that VIEWER.INI will take another 4K
  296.     ReplaceListItem szExtras$, ASC(MID$(GetWindowsDir(), 1, 1)) - ASC("A") + 1, STR$(4096)
  297.     
  298.     '' Get amount of space required
  299.     StillNeed& = GetCopyListCost(szExtras$, szCosts$, szNeededs$)
  300.     
  301.     '' Put up a message if there is not enough space
  302.     FOR i% = 1 TO 26 STEP 1
  303.         IF VAL(GetListItem(szNeededs$, i%)) > 0 THEN
  304.     
  305.             SetSymbolValue "String1", LTRIM$(STR$(VAL(GetListItem(szCosts$, i%)) / 1024))
  306.             SetSymbolValue "String2", CHR$(i% - 1 + ASC("A"))
  307.     
  308.             TOOBIG:
  309.     
  310.             sz$ = UIStartDlg(CUIDLL$, TOOBIG, "FInfoDlgProc", 0, "")
  311.             IF sz$ = "REACTIVATE" THEN
  312.                 GOTO TOOBIG
  313.             END IF
  314.             UIPop 1
  315.             CopyFiles = 0
  316.             GOTO DONTCOPY
  317.         END IF
  318.     NEXT i%
  319.     
  320.     '' Copy the files
  321.     CopyFilesInCopyList
  322.     
  323.     CopyFiles = 1
  324.  
  325. DONTCOPY:
  326.  
  327. END FUNCTION
  328.  
  329.  
  330. '*************************************************************************
  331. '** Purpose:
  332. '**     Puts up a success dialog
  333. '*************************************************************************
  334.  
  335. SUB ShowSuccess STATIC
  336.  
  337.     SUCCESS:
  338.     
  339.     SetSymbolValue "String1", TitleShortName$
  340.     sz$ = UIStartDlg(CUIDLL$, SUCCESS, "FInfoDlgProc", 0, "")
  341.     IF sz$ = "REACTIVATE" THEN
  342.         GOTO SUCCESS
  343.     END IF
  344.     UIPop 1   
  345.     
  346.     AFTERINSTALLING:
  347.     SetSymbolValue "String1", TitleShortName$+" setup"
  348.     sz$ = UIStartDlg(CUIDLL$, AFTERINSTALL, "FInfoDlgProc", 0, "")
  349.     IF sz$ = "REACTIVATE" THEN
  350.         GOTO AFTERINSTALLING
  351.     END IF
  352.      UIPop 1
  353.     
  354. END SUB
  355. '*************************************************************************
  356. '** Purpose:
  357. '**     Puts up a dialog  after running the install program
  358. '*************************************************************************
  359.  
  360. SUB ShowEndStuff STATIC
  361.  
  362.      AFTERINSTALLING2:
  363.     SetSymbolValue "String1", "Aces Over Europe "   
  364.     SetSymbolValue "String2", "AOECD.BAT"   
  365.     
  366.     sz$ = UIStartDlg(CUIDLL$, TOPLAY, "FInfoDlgProc", 0, "")
  367.     IF sz$ = "REACTIVATE" THEN
  368.         GOTO AFTERINSTALLING2
  369.     END IF
  370.     UIPop 1
  371.     
  372. END SUB
  373.  
  374.  
  375. '*************************************************************************
  376. '** Purpose:
  377. '**     Appends a file name to the end of a directory path,
  378. '**     inserting a backslash character as needed.
  379. '** Arguments:
  380. '**     szDir$  - full directory path (with optional ending "\")
  381. '**     szFile$ - filename to append to directory
  382. '** Returns:
  383. '**     Resulting fully qualified path name.
  384. '*************************************************************************
  385.  
  386. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  387.     IF szDir$ = "" THEN
  388.         MakePath = szFile$
  389.     ELSEIF szFile$ = "" THEN
  390.         MakePath = szDir$
  391.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  392.         MakePath = szDir$ + szFile$
  393.     ELSE
  394.         MakePath = szDir$ + "\" + szFile$
  395.     END IF
  396. END FUNCTION
  397.  
  398.  
  399. '*************************************************************************
  400. '** Purpose:
  401. '**     Registers a font.
  402. '** Arguments:
  403. '**     fontfile$ - font filename
  404. '**     fontname$ - font name.
  405. '*************************************************************************
  406.  
  407. SUB RegisterFont(fontfile$, fontname$) STATIC
  408.  
  409.     '' A simple error catching wrapper around AddFont, which is a 'C' routine in MSCUISTF.DLL
  410.  
  411.     IF AddFont(fontfile$, fontname$) = -1 THEN
  412.         j% = DoMsgBox("Could not install " + fontfile$ + " font.", "Viewer Font Installation", 0)
  413.     ENDIF
  414.  
  415. END SUB
  416.  
  417.  
  418. '*************************************************************************
  419. '** Purpose:
  420. '**     Registers title in VIEWER.INI
  421. '*************************************************************************
  422.  
  423. SUB ModifyViewerIni STATIC
  424.  
  425.     '' Get the VIEWER.INI file
  426.     
  427.     szIni$ = MakePath(GetWindowsDir(), "VIEWER.INI")
  428.  
  429.     '' First register the title file, setting the Name and Path entries. 
  430.     '' We assume that the MVB file is the same directory as SETUP.EXE.
  431.     ''
  432.     '' CUSTOMIZATION: If you're installing multiple MVB files, copy the
  433.     '' following two statements for each additional file, substituting
  434.     '' the appropriate long name and MVB filename for the TitleLongName$
  435.     '' and MVBFileName$ variables.
  436.     
  437.     CreateIniKeyValue szIni$, MVBFileName$, "Name", TitleLongName$, cmoOverwrite
  438.     CreateIniKeyValue szIni$, MVBFileName$, "Path", GetSymbolValue("STF_SRCDIR"), cmoOverwrite
  439.     
  440.     '' Now we have to register the MVB file in the [FILES] section, so 
  441.     '' Viewer can find files that are not on the path and display a 
  442.     '' special message when a file is not found.
  443.  
  444.     CreateIniKeyValue szIni$, "FILES", MVBFileName$ + ".MVB", GetSymbolValue("STF_SRCDIR") + "," + "Please insert the " + TitleLongName$ + " disk.", cmoOverwrite
  445.  
  446.     '' CUSTOMIZATION: If you're installing a Help title or any custom DLLs,
  447.     '' you should copy the preceding statement for each extra title or DLL.
  448.     ''
  449.     '' Example for installing an extra title:
  450.     ''
  451.     ''    CreateIniKeyValue szIni$, "FILES", "GALHELP.MVB", GetSymbolValue("STF_SRCDIR") + "," + "Please insert the Aces Over Europe game disk.", cmo
  452.     ''
  453.     '' Example for installing a custom DLL:
  454.     ''
  455.     ''    CreateIniKeyValue szIni$, "FILES", "GALLERY.DLL", GetSymbolValue("STF_SRCDIR") + "," + "A required file is missing. Please reinstall the Viewer Gallery.", cmoOverwrite
  456.  
  457. END SUB
  458.  
  459.  
  460. '*************************************************************************
  461. '** Purpose:
  462. '**     Creates program manager entries for the title
  463. '*************************************************************************
  464.  
  465. SUB ModifyProgramManager(szTitleDir$) STATIC
  466.     drive$=MID$(GetSymbolValue("STF_SRCDIR"),1,3)
  467.  
  468. '* place any demos here
  469.     CreateProgmanItem DemoGroup$, "Aces of the Deep Demo", MakePath(drive$+"DEMOS\ACESDEEP", "ACESDEEP.PIF"), MakePath(drive$+"DEMOS", "recorder.ico"), cmoOverwrite
  470.     CreateProgmanItem DemoGroup$, "Aces of the Pacific Demo", MakePath(drive$+"DEMOS\AOTP", "DEMO.PIF"), MakePath(drive$+"DEMOS", "recorder.ico"), cmoOverwrite
  471.     CreateProgmanItem DemoGroup$, "A10 1.5 Demo", MakePath(drive$+"DEMOS\A10", "DEMO.PIF"), MakePath(drive$+"DEMOS", "recorder.ico"), cmoOverwrite
  472.     CreateProgmanItem DemoGroup$, "Red Baron Demo", MakePath(drive$+"DEMOS\REDBARON", "DEMO.PIF"), MakePath(drive$+"DEMOS", "recorder.ico"), cmoOverwrite
  473.     CreateProgmanItem DemoGroup$,"Install INN Sampler", MakePath(drive$+"INN","install.bat"), MakePath(drive$+"INN","setup.ico"), cmoOverwrite  
  474.  
  475.     '' Create the program manager group
  476.  
  477.     CreateProgmanGroup ProgmanGroup$, "", cmoNone
  478.     ShowProgmanGroup ProgmanGroup$, 1, cmoNone
  479.     '' Create an entry for the title
  480.  
  481.     IF installChoice$ = "CONTINUE" THEN     
  482.         CreateProgmanItem ProgmanGroup$,"Aces Over Europe", MakePath(szTitleDir$,"windyn.exe")+" "+szTitleDir$,"", cmoOverwrite
  483.         CreateProgmanItem ProgmanGroup$,"Aces Over Europe Setup", MakePath(szTitleDir$,"wininst.exe")+" "+szTitleDir$, "", cmoOverwrite  
  484.         IF CreateGamePif(szTitleDir$+"\","-n"+szTitleDir$,MakePath(szTitleDir$,"game.pif"),"gcd.com")=0 THEN
  485.             i%=DoMsgBox("Pif File Error","Error",0)
  486.         END IF 
  487.         IF CreateGamePif(szTitleDir$+"\","-n"+szTitleDir$,MakePath(szTitleDir$,"gamejoy.pif"),"gcdjoy.com")=0 THEN
  488.             i%=DoMsgBox("Pif File Error","Error",0)
  489.         END IF 
  490.         IF CreateGameBatchFile(MakePath(szTitleDir$,"AOECD.bat"),szTitleDir$,"-n"+szTitleDir$,"gcd.com")=0 THEN
  491.             i%=DoMsgBox("Batch File Error","Error",0)
  492.         END IF 
  493.         IF CreateGameBatchFile(MakePath(szTitleDir$,"AOECDJOY.bat"),szTitleDir$,"-n"+szTitleDir$,"gcdjoy.com")=0 THEN
  494.             i%=DoMsgBox("Batch File Error","Error",0)
  495.         END IF 
  496. IF CreateGameINIFile(MakePath(szTitleDir$,"game.ini"),"[GAME]",    "name="+TitleLongName$,"workDir="+szTitleDir$,"cddir="+GetSymbolValue("STF_SRCDIR"),"FullInstall=TRUE","version=.05","mem=570000")=0 THEN
  497.             i%=DoMsgBox("Ini File Error","Error",0)
  498.         END IF 
  499.         
  500.     ELSE
  501.         CreateProgmanItem ProgmanGroup$,"Aces Over Europe", MakePath(GetSymbolValue("STF_SRCDIR"),"windyn.exe")+" "+szTitleDir$,"", cmoOverwrite
  502.         CreateProgmanItem ProgmanGroup$,"Aces Over Europe Setup", MakePath(GetSymbolValue("STF_SRCDIR"),"wininst.exe")+" "+szTitleDir$, "", cmoOverwrite  
  503.         IF CreateGamePif(GetSymbolValue("STF_SRCDIR"),"-n"+szTitleDir$,MakePath(szTitleDir$,"game.pif"),"gcd.com")=0 THEN
  504.             i%=DoMsgBox("Pif Open  File Error","Error",0) 
  505.         END IF
  506.         IF CreateGamePif(GetSymbolValue("STF_SRCDIR"),"-n"+szTitleDir$,MakePath(szTitleDir$,"gamejoy.pif"),"gcdjoy.com")=0 THEN
  507.             i%=DoMsgBox("Pif Open  File Error","Error",0) 
  508.         END IF
  509.         IF CreateGameBatchFile(MakePath(szTitleDir$,"AOECD.bat"),GetSymbolValue("STF_SRCDIR"),"-n"+szTitleDir$,"gcd.com")=0 THEN
  510.             i%=DoMsgBox("Batch File Error","Error",0)
  511.         END IF 
  512.         IF CreateGameBatchFile(MakePath(szTitleDir$,"AOECDJOY.bat"),GetSymbolValue("STF_SRCDIR"),"-n"+szTitleDir$,"gcdjoy.com")=0 THEN
  513.             i%=DoMsgBox("Batch File Error","Error",0)
  514.         END IF 
  515. IF CreateGameINIFile(MakePath(szTitleDir$,"game.ini"),"[GAME]","name="+TitleLongName$,"workDir="+szTitleDir$,"cddir="+GetSymbolValue("STF_SRCDIR"),"FullInstall=FALSE","version=.05","mem=570000")=0 THEN
  516.             i%=DoMsgBox("Ini File Error","Error",0)
  517.         END IF 
  518.     END IF       
  519.     CreateProgmanItem ProgmanGroup$, ProgmanItem$, "mviewer2.exe " + MakePath(GetSymbolValue("STF_SRCDIR"), MVBFileName$ + ".MVB"), MakePath(szTitleDir$,"manual.ico"), cmoOverwrite
  520. '*    CreateProgmanItem ProgmanGroup$, "Tech Help?", "mviewer2.exe " + MakePath(GetSymbolValue("STF_SRCDIR"), "techhelp.MVB"), MakePath(szTitleDir$,"help.ico"), cmoOverwrite
  521.     CreateProgmanItem ProgmanGroup$, "Read Me", "mviewer2.exe " + MakePath(szTitleDir$, "readme.MVB"),MakePath(szTitleDir$,"readme.ico"), cmoOverwrite
  522.     CreateProgmanItem ProgmanGroup$, "Boot Disk Maker", MakePath(szTitleDir$, "bootdisk.exe"), MakePath(szTitleDir$, "setup.ico"), cmoOverwrite
  523.         
  524.     
  525.     '' CUSTOMIZATION: 
  526.     ''
  527.     '' To create additional Program Manager items, copy the preceding 
  528.     '' statement for each additional item, substituting the appropriate
  529.     '' name for the MVBFileName$ variable.
  530.     ''
  531.     '' To display a custom icon with the Program Manager item, specify
  532.     '' the icon filename with the fourth parameter (this parameter is 
  533.     '' currently an empty string, ""). The following example specifies 
  534.     '' an icon with the same filename as the .MVB file:
  535.     ''
  536.     ''       CreateProgmanItem ProgmanGroup$, ProgmanItem$, "mviewer2.exe " + MakePath(GetSymbolValue("STF_SRCDIR"), MVBFileName$ + ".MVB"), MakePath(GetSymbolValue("STF_SRCDIR"), MVBFileName$ + ".ICO"), cmoOverwrite
  537.  
  538. END SUB
  539.  
  540.  
  541. '*************************************************************************
  542. '** Purpose:
  543. '**     Registers custom fonts with Windows.
  544. '*************************************************************************
  545.  
  546. SUB RegisterCustomFonts STATIC
  547.  
  548.     '' CUSTOMIZATION: If you install custom fonts, then add statements
  549.     '' in this routine to register the fonts with the current Windows 
  550.     '' session and to add them to the WIN.INI [Fonts] section. 
  551.     ''
  552.     '' Note that TrueType fonts can only be installed in Windows 3.1.
  553.     '' RegisterFont automatically creates the required .FOT file for 
  554.     '' TrueType fonts.
  555.     ''    
  556.     '' The following example registers a font residing in MISTRAL.TTF
  557.     '' and installs the font with the name Mistral (True Type):
  558.     '' 
  559.     ''     RegisterFont "mistral.ttf", "Mistral (TrueType)"
  560.     ''
  561.  
  562. END SUB
  563.  
  564.  
  565. '*************************************************************************
  566. '** Purpose:
  567. '**     Registers Windows drivers
  568. '*************************************************************************
  569.  
  570. SUB RegisterDrivers STATIC
  571.  
  572. '' CUSTOMIZATION: Video for Windows is not a standard component of
  573. '' Windows 3.1. If your title uses video, proceed as follows.
  574. ''
  575. '' 1) Add the following files to the [System Files] section of the INF file:
  576. ''
  577. ''    dispdib.dll
  578. ''    msvideo.dll
  579. ''    indeo.drv
  580. ''    mciavi.drv
  581. ''    msvidc.drv
  582. ''
  583. '' 2) Add the above files to your release directory. US versions can be 
  584. ''    found in the \SYSTEM subdirectory of your Viewer disc. French and
  585. ''    German versions were not available at ship time. Please contact 
  586. ''    Microsoft or check the Multimedia Viewer section on the Microsoft
  587. ''    Compuserve Forum for further details.
  588. ''
  589. '' 3) Uncomment the following lines:
  590. ''
  591. '' CreateIniKeyValue "WIN.INI", "mci extensions", "AVI", "AVIVIDEO", cmoNone
  592. '' CreateIniKeyValue MakePath(GetWindowsDir(), "SYSTEM.INI"), "mci", "AVIVIDEO", "MCIAVI.DRV", cmoNone
  593. '' CreateIniKeyValue MakePath(GetWindowsDir(), "SYSTEM.INI"), "drivers", "vidc.msvc", "msvidc.drv", cmoNone
  594. '' CreateIniKeyValue MakePath(GetWindowsDir(), "SYSTEM.INI"), "drivers", "vidc.rt21", "indeo.drv", cmoNone
  595.  
  596. END SUB
  597.  
  598.  
  599.  
  600.